package com.yuedao.sender.model1;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * YuedaoXingApi
 * com.ydx.api.model.orm
 * Created by Chris Chen
 * 2018/4/12
 * Explain:
 */
@Entity(name = "ydx_driver_schedule")
public class DriverScheduleEntity {
    private int id;
    private int placeId;
    private int driverId;
    private Timestamp workDay;
    private Timestamp workShiftFrom;
    private Timestamp workShiftTo;
    private Integer workShift;
    private Timestamp signOn;
    private Timestamp signOff;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "place_id", nullable = false)
    public int getPlaceId() {
        return placeId;
    }

    public void setPlaceId(int placeId) {
        this.placeId = placeId;
    }

    @Basic
    @Column(name = "driver_id", nullable = false)
    public int getDriverId() {
        return driverId;
    }

    public void setDriverId(int driverId) {
        this.driverId = driverId;
    }

    @Basic
    @Column(name = "work_day", nullable = false)
    public Timestamp getWorkDay() {
        return workDay;
    }

    public void setWorkDay(Timestamp workDay) {
        this.workDay = workDay;
    }

    @Basic
    @Column(name = "work_shift_from", nullable = true)
    public Timestamp getWorkShiftFrom() {
        return workShiftFrom;
    }

    public void setWorkShiftFrom(Timestamp workShiftFrom) {
        this.workShiftFrom = workShiftFrom;
    }

    @Basic
    @Column(name = "work_shift_to", nullable = true)
    public Timestamp getWorkShiftTo() {
        return workShiftTo;
    }

    public void setWorkShiftTo(Timestamp workShiftTo) {
        this.workShiftTo = workShiftTo;
    }

    @Basic
    @Column(name = "work_shift", nullable = true)
    public Integer getWorkShift() {
        return workShift;
    }

    public void setWorkShift(Integer workShift) {
        this.workShift = workShift;
    }

    @Basic
    @Column(name = "sign_on", nullable = true)
    public Timestamp getSignOn() {
        return signOn;
    }

    public void setSignOn(Timestamp signOn) {
        this.signOn = signOn;
    }

    @Basic
    @Column(name = "sign_off", nullable = true)
    public Timestamp getSignOff() {
        return signOff;
    }

    public void setSignOff(Timestamp signOff) {
        this.signOff = signOff;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DriverScheduleEntity that = (DriverScheduleEntity) o;
        return id == that.id &&
                placeId == that.placeId &&
                driverId == that.driverId &&
                Objects.equals(workDay, that.workDay) &&
                Objects.equals(workShiftFrom, that.workShiftFrom) &&
                Objects.equals(workShiftTo, that.workShiftTo) &&
                Objects.equals(workShift, that.workShift) &&
                Objects.equals(signOn, that.signOn) &&
                Objects.equals(signOff, that.signOff);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, placeId, driverId, workDay, workShiftFrom, workShiftTo, workShift, signOn, signOff);
    }
}
